﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EyFramework.Common;
using EyFramework.Sys.Core.Service;

namespace EyFramework.Library.Select
{
    /// <summary>
    /// 用户选择器
    /// </summary>
    public class FrmUserSelect:FrmDevSelect
    {
        private IMstStafService _mstStafService;

        private IList<GridColumnInfo> _columnInfos = new List<GridColumnInfo>();

        private string _input;
        public FrmUserSelect(string input)
        {
            this.Text = "员工选择";
            _mstStafService = Globals.GetService<IMstStafService>();
            _input = input;
            InitColumns();
        }

        private void InitColumns()
        {
            _columnInfos.Add(new GridColumnInfo("STAFF_CODE", "员工工号"));
            _columnInfos.Add(new GridColumnInfo("STAFF_NAME", "姓名"));
            _columnInfos.Add(new GridColumnInfo("FIVE_CODE", "五笔码"));
            _columnInfos.Add(new GridColumnInfo("SPELL_CODE", "拼音码"));
        }

        protected override void QueryData()
        {
            loading.ShowWaitForm();
            gcData.DataSource = _mstStafService.SelectBy(_input);
            DevPublic.SetGridControlView(gvData, _columnInfos, true, true);
            loading.CloseWaitForm();
        }

        private void InitializeComponent()
        {
            this.SuspendLayout();
            // 
            // FrmUserSelect
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
            this.ClientSize = new System.Drawing.Size(542, 352);
            this.Name = "FrmUserSelect";
            this.ResumeLayout(false);

        }
    }
}
